/**
 * Created by zhangwenlei on 2017/5/23.
 */
BCP.bill.control.Listbasedata = function(){
    BCP.bill.control.Listbasedata.superclass.constructor.call(this);
};

COM.util.defineClass(BCP.bill.control.Listbasedata, ADF.ControlDescriptor,{

    getEditpart : function(){
        var editpart = function(){
            editpart.superclass.constructor.call(this);
        };
        COM.util.defineClass(editpart, ADF.editpart.BaseEditpart, {
            _createFigure: function() {
                var figure = new AGEF.WidgetFigure(this.id);
                var listbasedata = this.getWidgetFactory().createControl(this.getModel());
                figure.setWidget(listbasedata);
                return figure;
            },
            // createEditPolicies: function() {
            //     this.installEditPolicy(COM.gef.EditPolicy.COMPONENT_ROLE, new AGEF.ComponentEditPolicy());
            // },
            propertyChange: function(evt) {
                editpart.superclass.propertyChange.call(this, evt);
                if (AGEF.PropertyChangeEvent.UPDATE_EVENT == evt.getType()) {
                    if (BCP.bill.model.ListbasedataModel.PROPERTY_INIT_DATA == evt.getPropertyName()) {
                        this.getFigure().getWidget().setInitData(evt.newValue);
                    } else if (BCP.bill.model.ListbasedataModel.PROPERTY_PROVIDER == evt.getPropertyName()) {
                        this.getFigure().getWidget().setProvider(evt.newValue);
                    } else if(BCP.bill.model.ListbasedataModel.PROPERTY_BINDING==evt.getPropertyName()){
                        this.getFigure().getWidget().setBinding(evt.newValue);
                    }
                }
            }
        });
        return editpart;
    },

    getModel : function(){
        return BCP.bill.model.ListbasedataModel;
    },

    getDomControl:function(){
        return BCP.bill.domControl.Listbasedata;
    }

});